﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace QuanLyThuNgan
{
    public class DMNoiGuiDichVuDAO
    {
        public bool m_Insert(DMNoiGuiDichVuDTO _info)
        {
            int dv = 0;
            if (_info.BBNgungSuDung == true)
                dv = 1;
            string _sql = string.Format("usp_ThuNgan_DMNoiGuiDichVu_Insert  N'{0}',N'{1}',{2}", _info.STenNoiGuiDichVu, _info.STenVni, dv);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }
        public bool m_Update(DMNoiGuiDichVuDTO _info)
        {
            int dv = 0;
            if (_info.BBNgungSuDung == true)
                dv = 1;
            string _sql = string.Format("usp_ThuNgan_DMNoiGuiDichVu_Update {0},N'{1}',N'{2}',{3}", _info.IIDNoiGuiDichVu, _info.STenNoiGuiDichVu, _info.STenVni, dv);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }
        public bool m_Delete(DMNoiGuiDichVuDTO _info)
        {
            string _sql = string.Format("usp_ThuNgan_DMNoiGuiDichVu_Delete {0}", _info.IIDNoiGuiDichVu);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }

        public DataTable m_SelectAllDMNoiGuiDV()
        {
            string _sql = string.Format("usp_ThuNgan_DMNoiGuiDichVu_SelectAll ");
            return Uit.it_SQL.getDataTable(_sql, null, "");
        }

        public DataTable m_SelectDMNoiGuiDV()
        {
            string _sql = string.Format("usp_ThuNgan_DMNoiGuiDichVu_SelectTenNoiGui");
            return Uit.it_SQL.getDataTable(_sql, null, "");
        }

    }
}
